package ee.ttu.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * Created by Vahur Kaar on 11.03.2015.
 */
@Entity
@Table(name = "TAHTAEG", schema = "public")
public class Tahtaeg implements Serializable {

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO, generator = "tahtaeg_seq")
	@SequenceGenerator(name = "tahtaeg_seq", sequenceName = "s_tahtaeg", schema = "public")
	@Column(name = "ID")
	private Long id;

	@Column(name = "AEG")
	private Date aeg;

	@Column(name = "SEMESTER")
	private String semester;

	@ManyToOne
	@JoinColumn(name = "SEOTUD_VAHEULESANNE", referencedColumnName = "ID")
	private Vaheulesanne seotud_vaheulesanne;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Date getAeg() {
		return aeg;
	}

	public void setAeg(Date aeg) {
		this.aeg = aeg;
	}

	public String getSemester() {
		return semester;
	}

	public void setSemester(String semester) {
		this.semester = semester;
	}

	public Vaheulesanne getSeotud_vaheulesanne() {
		return seotud_vaheulesanne;
	}

	public void setSeotud_vaheulesanne(Vaheulesanne seotud_vaheulesanne) {
		this.seotud_vaheulesanne = seotud_vaheulesanne;
	}

}